<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org">
<head th:include="_header_include::frag(~{::title},~{},~{})">
    <title>重单列表</title>
    <style>
    </style>
</head>
<body>
<div v-loading="loading" id="organizationManage" class="organizationManage mainPadding" style="display: none;">    
    <el-breadcrumb separator="/" class="elBreadcrumb marginB20" v-if="isElBreadcrumb">
        <el-breadcrumb-item>Home</el-breadcrumb-item>
        <el-breadcrumb-item>电销管理</el-breadcrumb-item>
        <el-breadcrumb-item>重单列表</el-breadcrumb-item>
    </el-breadcrumb>
    <table-uniontabtemplate :param="dataUrlParam" v-else></table-uniontabtemplate>
    <el-row class="marginB20">
        <!--< el-button type="primary" @click="cancelButton">撤销申请</el-button> -->
        <el-button type="primary" @click="detailButton">查看详情</el-button>
    </el-row>
    <div class="mainSearchBg">
        <div class="mainSearchFormBox">
            <el-form :inline="true" class="demo-form-inline mainSearchForm">
                <el-form-item label="处理状态:"  >
                    <el-select filterable v-model="status" placeholder="处理状态" clearable>
                        <el-option
                            v-for="item in statusList"
                            :key="item.value"
                            :label="item.label"
                            :value="item.value">
                        </el-option>
                    </el-select>
                </el-form-item>
                <el-form-item label="是否重单:" >
                    <el-select filterable v-model="dealStatus" placeholder="是否重单" clearable>
                        <el-option
                            v-for="item in repetitionList"
                            :key="item.value"
                            :label="item.label"
                            :value="item.value">
                        </el-option>
                    </el-select>
                </el-form-item>
                <el-form-item label="客户姓名:" >
                    <el-input v-model="cusName" placeholder="客户姓名"></el-input>
                </el-form-item>
                <el-form-item label="客户手机号:" >
                    <el-input v-model="cusPhone" placeholder="客户手机号"></el-input>
                </el-form-item>
                <!-- <div class="mainSearchBtnBox">  -->
                <!--<el-form-item label="">-->
                <!--<el-button icon="el-icon-search" type="primary" @click="search" style="margin-left: 10px">搜索</el-button>-->
                <!--</el-form-item>-->
                <el-row v-show="isShowSearch">
                    <el-form-item label="是否签约:" prop="isSign">
                        <el-select v-model="isSign" clearable placeholder="是否签约">
                            <el-option v-for="item in isSignOptions" :key="item.value" :label="item.name"
                                       :value="item.value"></el-option>
                        </el-select>
                    </el-form-item>
                    <el-form-item label="是否补齐尾款:">
                        <el-select v-model="isTailMoney" placeholder="是否补齐尾款" clearable>
                            <el-option v-for="item in isTailMoneyArr" :key="item.value" :label="item.label"
                                       :value="item.value">
                            </el-option>
                        </el-select>
                    </el-form-item>
                </el-row>
                <div class="mainSearchBtnBox">
                    <el-button icon="el-icon-search" type="primary" @click="search" style="margin-left: 10px">搜索</el-button>
                    <!-- <el-button type="info" class="searchBtn">取消</el-button> -->
                    <span style="color: #5c6be8;cursor: pointer;margin:0 10px;" @click="toogleClick"><span v-if="isShowSearch">收起</span><span v-else>展开更多</span><i :class="{'greycolor paddingL6 el-icon-arrow-up':isShowSearch,'greycolor paddingL6 el-icon-arrow-down':!isShowSearch}"></i></span>
                </div>
            </el-form>
        </div>
        <el-table
            ref="multipleTable"
            tooltip-effect="dark"
            empty-text="无数据"
            style="width: 100%"
            border
            :data="dataTable"  @selection-change="handleSelectionChange">
            <el-table-column align="center" prop="id" type="selection" width="55"></el-table-column>
            <!-- <el-table-column prop="date" label="全选" width="180"></el-table-column>  -->
            <el-table-column align="center" type="index" prop="id" label="序号" width="55"></el-table-column>
            <el-table-column align="center" prop="cusName" label="客户姓名">
                <template slot-scope="scope">
                    {{scope.row.cusName}}
                    <span v-if="scope.row.inputType ==1">
                        <input type='hidden'><img th:src="@{/images/self_build.png}"  style="margin:0 10px;width:22px;cursor: pointer;vertical-align: middle;" alt="">
                    </span>
                </template>
            </el-table-column>
            <el-table-column align="center" prop="cusPhone" label="客户手机号"></el-table-column>
            <el-table-column prop="" label="重复手机号资源"  align="center" show-overflow-tooltip>
                <template slot-scope="scope">
            		<span v-if="scope.row.isRepeatPhone ==1">
                	<el-button @click="repeatPhonesClick(scope.row)" type="text" size="small">点击查看</el-button>
            	</span>
                </template>
            </el-table-column>
            <el-table-column align="center" prop="customerStatusName" label="客户状态"></el-table-column>
            <el-table-column align="center" prop="createTime" label="提交重单申请时间" :formatter="dateFormat"></el-table-column>
            <el-table-column align="center" prop="dealStatusResult" label="重单结果"></el-table-column>
            <el-table-column align="center" prop="statusResult" label="处理状态" ></el-table-column>
            <el-table-column align="center" prop="applyUser" label="重单顾问姓名"></el-table-column>
            <el-table-column align="center" prop="applyUser" label="判单明细">
                <template slot-scope="scope">
            		<span v-if="scope.row.auditStatus ==1">
                	<el-button @click="repeatDetailButton(scope.row)" type="text" size="small">点击查看</el-button>
            	</span>
                </template>
            </el-table-column>
        </el-table>
        <table-pagination :pager="pager"  @change="queryRepeatPage"></table-pagination>
    </div>
    <!-- dialog -->
    <el-dialog title="重单详情" :visible.sync="dialogFormVisible">
        <el-form   class="width500">
            <el-form-item label="重单手机号：" :label-width="formLabelWidth" >{{cusPhoneId}}
            </el-form-item>
            <div v-if="isShowRepetition ==true">
                <el-form-item label="运作区域：" :label-width="formLabelWidth" >{{operatingArea}}
                </el-form-item>
                <el-form-item label="考察时间：" :label-width="formLabelWidth" >{{investigateTime}}
                </el-form-item>
                <el-form-item label="考察地点：" :label-width="formLabelWidth" >{{investigateArea}}
                </el-form-item>
                <el-form-item label="考察项目：" :label-width="formLabelWidth" >{{projectName}}
                </el-form-item>
                <el-form-item label="协商结果：" :label-width="formLabelWidth" >{{consultResults}}
                </el-form-item>
            </div>
            <el-form-item label="提交备注：" :label-width="formLabelWidth" >{{remarkId}}
            </el-form-item>
            <el-form-item label="处理状态：" :label-width="formLabelWidth" >{{statusId}}

            </el-form-item>
            <el-form-item label="处理结果："  :label-width="formLabelWidth" >{{dealStatusId}}
            </el-form-item>
            <el-form-item label="处理备注：" :label-width="formLabelWidth" >{{dealRemarkId}}
            </el-form-item>
            <el-form-item label="分配比例：" v-show="isShow" :label-width="formLabelWidth" >
                <el-table
                    ref="multipleTable"
                    tooltip-effect="dark"
                    empty-text="无数据"
                    style="width: 100%"
                    border
                    :data="repetitionDetailList"  >
                    <el-table-column align="center" prop="repeatName" label="顾问姓名"></el-table-column>
                    <el-table-column align="center" prop="repeatRatio" :formatter="addCent" label="比例" ></el-table-column>
                </el-table>
            </el-form-item>
        </el-form>
    </el-dialog>
    <!-- dialog -->
    <el-dialog title="判单明细" :visible.sync="repeatDetaildialogFormVisible" width="1100px">
        <el-table
            ref="multipleTable"
            tooltip-effect="dark"
            empty-text="无数据"
            style="width: 100%"
            border
            :data="detailList"  >
            <el-table-column align="center" type="index"  label="序号" width="55"></el-table-column>
            <el-table-column align="center" prop="signNo"  label="签约单编号" ></el-table-column>
            <el-table-column align="center" prop="statementNo"  label="结算单编号" width="130"></el-table-column>
            <el-table-column align="center" prop="payMode"  label="付款方式" width="110" :formatter="payMode"></el-table-column>
            <el-table-column align="center" prop="payType" label="付款类型" :formatter="paytype" width="110"></el-table-column>
            <el-table-column align="center" prop="amountPerformance" label="业绩金额" width="110"></el-table-column>
            <el-table-column align="center" prop="userNames" label="重单人员"></el-table-column>
            <el-table-column align="center" prop="repeatRatios" label="分配比例"></el-table-column>
        </el-table>
        </el-form>
    </el-dialog>
    <!-- dialog -->
    <el-dialog title="判单明细" :visible.sync="repeatPayDetaildialogFormVisible">
        <el-table
            ref="multipleTable"
            tooltip-effect="dark"
            empty-text="无数据"
            style="width: 100%"
            border
            :data="payDetailList"  >
            <el-table-column align="center" prop="repeatName" label="顾问姓名"></el-table-column>
            <el-table-column align="center" prop="repeatRatio" :formatter="addCent" label="比例" ></el-table-column>
        </el-table>
        </el-form>
    </el-dialog>
    <el-dialog :title="'资源ID'+dailogTitleType+'重复手机号资源信息'"    :visible.sync="repeatPhonesDialog" width="1000px">
        <div v-show="showPhoneTable">
            <p style="margin:10px 0;">手机号<span style="color: red">(1)</span>{{phone}}重复手机号资源</p>
            <el-table ref="singleTable" tooltip-effect="dark" style="width: 100%" border :data="repeatPhonesTable">
                <el-table-column align="center" type="index" width="55" label="序号"></el-table-column>
                <el-table-column align="center" prop="createTime" label="资源创建时间" width="150">
                    <template slot-scope="scope">
                        <div v-if="scope.row.phase == 1 || scope.row.phase == 2">
                            <font color="red">「重话务」</font>{{scope.row.createTime}}
                        </div>
                        <div v-else>
                            {{scope.row.createTime}}
                        </div>
                    </template>
                </el-table-column>
                <el-table-column align="center" prop="phoneChangeTime" label="联系方式创建时间" width="150"></el-table-column>
                <el-table-column align="center" prop="teleDirectorName" label="电销总监" width="130"></el-table-column>
                <el-table-column align="center" prop="teleSaleName" label="电销顾问" width="130"></el-table-column>
                <el-table-column align="center" prop="teleGorupName" label="电销组" width="130"></el-table-column>
                <el-table-column align="center" prop="teleReceiveTime" label="分配时间" width="170">
                    <template slot-scope="scope">
                        <div v-if="scope.row.teleReceiveSource == 1 || scope.row.teleReceiveSource == 2">
                            {{scope.row.teleReceiveTime}}(分配)
                        </div>
                        <div v-else-if="scope.row.teleReceiveSource ===3">
                            {{scope.row.teleReceiveTime}}(领取)
                        </div>
                        <div v-else-if="scope.row.teleReceiveSource ===4">
                            {{scope.row.teleReceiveTime}}(自建)
                        </div>
                        <div v-else-if="scope.row.teleReceiveSource ===5">
                            {{scope.row.teleReceiveTime}}(分发)
                        </div>
                        <div v-else>
                            {{scope.row.teleReceiveTime}}
                        </div>
                    </template>
                </el-table-column>
                <el-table-column align="center" prop="fowEndTime" label="最新跟进时间"></el-table-column>
                <el-table-column align="center" prop="teleProject" label="电销组负责项目"></el-table-column>
                <el-table-column align="center" prop="createUserRoleName" label="资源创建人角色" width="130"></el-table-column>
                <el-table-column align="center" prop="createUserName" label="资源创建人" width="110"></el-table-column>
            </el-table>
        </div>
        <div v-show="showPhoneTable2">
            <p style="margin:10px 0;">手机号<span style="color: red">(2)</span>{{phone2}}重复手机号资源</p>
            <el-table ref="singleTable2" tooltip-effect="dark" style="width: 100%" border :data="repeatPhonesTable2">
                <el-table-column align="center" type="index" width="55" label="序号"></el-table-column>
                <el-table-column align="center" prop="createTime" label="资源创建时间" width="150">
                    <template slot-scope="scope">
                        <div v-if="scope.row.phase == 1 || scope.row.phase == 2">
                            <font color="red">「重话务」</font>{{scope.row.createTime}}
                        </div>
                        <div v-else>
                            {{scope.row.createTime}}
                        </div>
                    </template>
                </el-table-column>
                <el-table-column align="center" prop="phoneChangeTime" label="联系方式创建时间" width="150"></el-table-column>
                <el-table-column align="center" prop="teleDirectorName" label="电销总监" width="130"></el-table-column>
                <el-table-column align="center" prop="teleSaleName" label="电销顾问" width="130"></el-table-column>
                <el-table-column align="center" prop="teleGorupName" label="电销组" width="130"></el-table-column>
                <el-table-column align="center" prop="teleReceiveTime" label="分配时间" width="170">
                    <template slot-scope="scope">
                        <div v-if="scope.row.teleReceiveSource == 1 || scope.row.teleReceiveSource == 2">
                            {{scope.row.teleReceiveTime}}(分配)
                        </div>
                        <div v-else-if="scope.row.teleReceiveSource ===3">
                            {{scope.row.teleReceiveTime}}(领取)
                        </div>
                        <div v-else-if="scope.row.teleReceiveSource ===4">
                            {{scope.row.teleReceiveTime}}(自建)
                        </div>
                        <div v-else-if="scope.row.teleReceiveSource ===5">
                            {{scope.row.teleReceiveTime}}(分发)
                        </div>
                        <div v-else>
                            {{scope.row.teleReceiveTime}}
                        </div>
                    </template>
                </el-table-column>
                <el-table-column align="center" prop="fowEndTime" label="最新跟进时间"></el-table-column>
                <el-table-column align="center" prop="teleProject" label="电销组负责项目"></el-table-column>
                <el-table-column align="center" prop="createUserRoleName" label="资源创建人角色" width="130"></el-table-column>
                <el-table-column align="center" prop="createUserName" label="资源创建人" width="110"></el-table-column>
            </el-table>
        </div>
        <div v-show="showPhoneTable3">
            <p style="margin:10px 0;">手机号<span style="color: red">(3)</span>{{phone3}}重复手机号资源</p>
            <el-table ref="singleTable3" tooltip-effect="dark" style="width: 100%" border :data="repeatPhonesTable3">
                <el-table-column align="center" type="index" width="55" label="序号"></el-table-column>
                <el-table-column align="center" prop="createTime" label="资源创建时间" width="150">
                    <template slot-scope="scope">
                        <div v-if="scope.row.phase == 1 || scope.row.phase == 2">
                            <font color="red">「重话务」</font>{{scope.row.createTime}}
                        </div>
                        <div v-else>
                            {{scope.row.createTime}}
                        </div>
                    </template>
                </el-table-column>
                <el-table-column align="center" prop="phoneChangeTime" label="联系方式创建时间" width="150"></el-table-column>
                <el-table-column align="center" prop="teleDirectorName" label="电销总监" width="130"></el-table-column>
                <el-table-column align="center" prop="teleSaleName" label="电销顾问" width="130"></el-table-column>
                <el-table-column align="center" prop="teleGorupName" label="电销组" width="130"></el-table-column>
                <el-table-column align="center" prop="teleReceiveTime" label="分配时间" width="170">
                    <template slot-scope="scope">
                        <div v-if="scope.row.teleReceiveSource == 1 || scope.row.teleReceiveSource == 2">
                            {{scope.row.teleReceiveTime}}(分配)
                        </div>
                        <div v-else-if="scope.row.teleReceiveSource ===3">
                            {{scope.row.teleReceiveTime}}(领取)
                        </div>
                        <div v-else-if="scope.row.teleReceiveSource ===4">
                            {{scope.row.teleReceiveTime}}(自建)
                        </div>
                        <div v-else-if="scope.row.teleReceiveSource ===5">
                            {{scope.row.teleReceiveTime}}(分发)
                        </div>
                        <div v-else>
                            {{scope.row.teleReceiveTime}}
                        </div>
                    </template>
                </el-table-column>
                <el-table-column align="center" prop="fowEndTime" label="最新跟进时间"></el-table-column>
                <el-table-column align="center" prop="teleProject" label="电销组负责项目"></el-table-column>
                <el-table-column align="center" prop="createUserRoleName" label="资源创建人角色" width="130"></el-table-column>
                <el-table-column align="center" prop="createUserName" label="资源创建人" width="110"></el-table-column>
            </el-table>
        </div>
        <div v-show="showPhoneTable4">
            <p style="margin:10px 0;">手机号<span style="color: red">(4)</span>{{phone4}}重复手机号资源</p>
            <el-table ref="singleTable4" tooltip-effect="dark" style="width: 100%" border :data="repeatPhonesTable4">
                <el-table-column align="center" type="index" width="55" label="序号"></el-table-column>
                <el-table-column align="center" prop="createTime" label="资源创建时间" width="150">
                    <template slot-scope="scope">
                        <div v-if="scope.row.phase == 1 || scope.row.phase == 2">
                            <font color="red">「重话务」</font>{{scope.row.createTime}}
                        </div>
                        <div v-else>
                            {{scope.row.createTime}}
                        </div>
                    </template>
                </el-table-column>
                <el-table-column align="center" prop="phoneChangeTime" label="联系方式创建时间" width="150"></el-table-column>
                <el-table-column align="center" prop="teleDirectorName" label="电销总监" width="130"></el-table-column>
                <el-table-column align="center" prop="teleSaleName" label="电销顾问" width="130"></el-table-column>
                <el-table-column align="center" prop="teleGorupName" label="电销组" width="130"></el-table-column>
                <el-table-column align="center" prop="teleReceiveTime" label="分配时间" width="170">
                    <template slot-scope="scope">
                        <div v-if="scope.row.teleReceiveSource == 1 || scope.row.teleReceiveSource == 2">
                            {{scope.row.teleReceiveTime}}(分配)
                        </div>
                        <div v-else-if="scope.row.teleReceiveSource ===3">
                            {{scope.row.teleReceiveTime}}(领取)
                        </div>
                        <div v-else-if="scope.row.teleReceiveSource ===4">
                            {{scope.row.teleReceiveTime}}(自建)
                        </div>
                        <div v-else-if="scope.row.teleReceiveSource ===5">
                            {{scope.row.teleReceiveTime}}(分发)
                        </div>
                        <div v-else>
                            {{scope.row.teleReceiveTime}}
                        </div>
                    </template>
                </el-table-column>
                <el-table-column align="center" prop="fowEndTime" label="最新跟进时间"></el-table-column>
                <el-table-column align="center" prop="teleProject" label="电销组负责项目"></el-table-column>
                <el-table-column align="center" prop="createUserRoleName" label="资源创建人角色" width="130"></el-table-column>
                <el-table-column align="center" prop="createUserName" label="资源创建人" width="110"></el-table-column>
            </el-table>
        </div>
        <div v-show="showPhoneTable5">
            <p style="margin:10px 0;">手机号<span style="color: red">(5)</span>{{phone5}}重复手机号资源</p>
            <el-table ref="singleTable5" tooltip-effect="dark" style="width: 100%" border :data="repeatPhonesTable5">
                <el-table-column align="center" type="index" width="55" label="序号"></el-table-column>
                <el-table-column align="center" prop="createTime" label="资源创建时间" width="150">
                    <template slot-scope="scope">
                        <div v-if="scope.row.phase == 1 || scope.row.phase == 2">
                            <font color="red">「重话务」</font>{{scope.row.createTime}}
                        </div>
                        <div v-else>
                            {{scope.row.createTime}}
                        </div>
                    </template>
                </el-table-column>
                <el-table-column align="center" prop="phoneChangeTime" label="联系方式创建时间" width="150"></el-table-column>
                <el-table-column align="center" prop="teleDirectorName" label="电销总监" width="130"></el-table-column>
                <el-table-column align="center" prop="teleSaleName" label="电销顾问" width="130"></el-table-column>
                <el-table-column align="center" prop="teleGorupName" label="电销组" width="130"></el-table-column>
                <el-table-column align="center" prop="teleReceiveTime" label="分配时间" width="170">
                    <template slot-scope="scope">
                        <div v-if="scope.row.teleReceiveSource == 1 || scope.row.teleReceiveSource == 2">
                            {{scope.row.teleReceiveTime}}(分配)
                        </div>
                        <div v-else-if="scope.row.teleReceiveSource ===3">
                            {{scope.row.teleReceiveTime}}(领取)
                        </div>
                        <div v-else-if="scope.row.teleReceiveSource ===4">
                            {{scope.row.teleReceiveTime}}(自建)
                        </div>
                        <div v-else-if="scope.row.teleReceiveSource ===5">
                            {{scope.row.teleReceiveTime}}(分发)
                        </div>
                        <div v-else>
                            {{scope.row.teleReceiveTime}}
                        </div>
                    </template>
                </el-table-column>
                <el-table-column align="center" prop="fowEndTime" label="最新跟进时间"></el-table-column>
                <el-table-column align="center" prop="teleProject" label="电销组负责项目"></el-table-column>
                <el-table-column align="center" prop="createUserRoleName" label="资源创建人角色" width="130"></el-table-column>
                <el-table-column align="center" prop="createUserName" label="资源创建人" width="110"></el-table-column>
            </el-table>
        </div>
    </el-dialog>

</div>
<input id="addOrUpdate" type="hidden" >
</body>
<!-- import common js-->
<div th:include="_footer_include :: #jsLib"></div>
<script th:inline="javascript">
  var payModeItem =[[${payModeItem}]];
  var userId = [[${userId}]];
  var roleCode = [[${roleCode}]];
  var orgId = [[${orgId}]];
  var isShowRepetition =[[${isShowRepetition}]];
  var orgVM =  new Vue({
    el: '#organizationManage',
    data: {
        dataUrlParam:{
            dataUrlArr:[{
                isActive:false,
                name:"未签约客户",
                url:"/tele/clueMyCustomerInfo/initmyCustomer?type=1",                
            },{
                isActive:false,
                name:"今日新增",
                url:"/tele/clueMyCustomerInfo/initmyCustomer?type=2"
            },
            {
                isActive:false,
                name:"今日回访",
                url:"/tele/clueMyCustomerInfo/customerVisitToday"
            },
            {
                isActive:false,
                name:"今日领取",
                url:"/tele/clueMyCustomerInfo/initmyCustomer?type=5"
            },
            {
                isActive:false,
                name:"自建客户",
                url:"/tele/clueMyCustomerInfo/initmyCustomer?type=3"
            },
            {
                isActive:true,
                name:"重单客户",
                url:"/clue/cluerepetition/queryRepeatPage?type=1"
            },
            {
                isActive:false,
                name:"邀约客户",
                url:"/clue/appiontment/initAppiontmentList?type=1"
            },
            {
                isActive:false,
                name:"已签约客户",
                url:" /tele/clueMyCustomerInfo/initmyCustomer?type=4"
            }]
        },
        isElBreadcrumb:true,
      isTailMoney:"",
      isSign:"",
      isShowSearch:false,
      dailogTitleType:"",
      operatingArea:"",
      investigateTime:"",
      investigateArea:"",
      projectName:"",
      consultResults:"",
      cusName:"",
      cusPhone:"",
      status:"",
      dealStatus:"",
      cusPhoneId:"",
      remarkId:"",
      dealRemarkId:"",
      dealStatusId:"",
      statusId:"",
      isShowRepetition:isShowRepetition,
      repeatPayDetaildialogFormVisible:false,
      repeatDetaildialogFormVisible:false,
      dialogFormVisible:false,
      repeatPhonesDialog:false,
      repetitionList:"",
      exportFormVisible:false,
      formLabelWidth: '100px',
      dialogFormVisible: false,
      addOrModifyDialogTitle:"",
      dialogFormVisible:false,
      dataTable:[],
      isShow:true,
      multipleSelection: [],
      repetitionDetailList:[],
      payDetailList:[],
      detailList:[],
      repeatPhonesTable:[],
      repeatPhonesTable2:[],
      repeatPhonesTable3:[],
      repeatPhonesTable4:[],
      repeatPhonesTable5:[],
      showPhoneTable:false,
      showPhoneTable2:false,
      showPhoneTable3:false,
      showPhoneTable4:false,
      showPhoneTable5:false,
      phone:'',
      phone2:'',
      phone3:'',
      phone4:'',
      phone5:'',
      isTailMoneyArr: [{value: '', label: '全部'}, {value: '0', label: '否'}, {value: '1', label: '是'}],
      isSignOptions: [{
        value: 0,
        name: "未签约"
      }, {
        value: 1,
        name: "已签约"
      }],
      statusList:[
        {
          value: '0',
          label: '待审批处理'
        },
        {
          value: '1',
          label: '已审批处理'
        }
      ],
      repetitionList:[
        {
          value: '0',
          label: '不重单'
        },
        {
          value: '1',
          label: '重单'
        }
      ],
      pager:{
        total: 0,
        currentPage: 1,
        pageSize: 20,
      },
      loading:false,


    },
    methods: {
      toogleClick(){
        if(this.isShowSearch){
          this.isShowSearch=false
        }else{
          this.isShowSearch=true
        }
      },
      //日期数据格式化方法
      dateFormat:function(row, column) {
        var date = row[column.property];
        if (date == undefined) {
          return "";
        }
        return moment(date).format("YYYY-MM-DD HH:mm:ss");
      },
      dateTimeFormats(date) {
        if(date !=null && date !=''){
          return moment(date).format("YYYY-MM-DD HH:mm:ss");
        }else{
          return "";
        }

      },
      consultResultsNum(num) {
        if(num !=null ){
          if(num ==0){
            return  "平分";
          }else if(num ==1){
            return  "判定";
          }
        }
        return "";
      },
      transCusPhone(row) {
        var text="";
        if( ( row.phase !=undefined  && (row.phase ==7 || row.phase == 8)) || (roleCode =='DXCYGW' && row.teleSaleIds !=undefined && row.teleSaleIds.indexOf(userId) == -1 )
            ||  (roleCode =='DXZJ' && row.teleGorupIds !=undefined && row.teleGorupIds.indexOf(orgId) == -1)
            ||  (roleCode =='DXFZ' && row.teleDeptIds !=undefined && row.teleDeptIds.indexOf(orgId) == -1)){
          text ="***"
        }else{
          text = row.cusPhone;
        }
        return text;
      },
      queryRepeatPage(){//查询按钮
        var param = {};
        var pageSize = this.pager.pageSize;
        var pageNum = this.pager.currentPage;
        param.pageNum = pageNum;
        param.pageSize = pageSize;
        param.dealStatus=this.dealStatus;
        param.cusName=this.cusName;
        param.cusPhone=this.cusPhone;
        param.status=this.status;
        param.isSign = this.isSign;
        param.isTailMoney = this.isTailMoney;
        console.log(param);
        axios.post('/clue/cluerepetition/queryRepeatList',param).then(function (response) {
          console.log(response);
          if(null===response||response.data==null||response.data.code!='0'){
            orgVM.$message({
              message: response.data.msg,
              type: 'warning'
            });
            return ;
          }else{
            var result =  response.data;
            console.info(result);
            var table=result.data;
            var data= table.data;
            for(var i=0;i<data.length;i++){
              console.log(data[i]);
              data[i].cusPhone=orgVM.transCusPhone(data[i]);
            }
            orgVM.dataTable = response.data.data.data;
            orgVM.pager.currentPage= response.data.data.currentPage;
            orgVM.pager.total= response.data.data.total;
          }
        })
        .catch(function (error) {
          console.log(error);
        })
        .then(function () {
        });

      } ,
      detailButton(){
        orgVM.isShow =false;
        var rows = this.multipleSelection;
        if(rows.length  !=1){
          this.$message({
            message: '请选择一条数据',
            type: 'warning'
          });
          return;
        }
        this.dialogFormVisible = true;
        var str = "";
        var text="";
        for ( var i = 0; i <rows.length; i++){
          str = rows[i].id
          if( ( rows[i].phase !=undefined  && (rows[i].phase ==7 || rows[i].phase == 8)) || (roleCode =='DXCYGW' && rows[i].teleSaleIds !=undefined && rows[i].teleSaleIds.indexOf(userId) == -1 )
              ||  (roleCode =='DXZJ' && rows[i].teleGorupIds !=undefined && rows[i].teleGorupIds.indexOf(orgId) == -1)
              ||  (roleCode =='DXFZ' && rows[i].teleDeptIds !=undefined && rows[i].teleDeptIds.indexOf(orgId) == -1)){
            text ="***";
          }else{
              var text = rows[i].cusPhone;
          }
        }
        var param={};
        param.id=str;
        axios.post('/clue/cluerepetition/queryRepeatById',param).then(function (response) {
          console.log(response);

          if(null !==response && response.data !=null && response.data.code=='0'){
            var clueRepetitionDTO = response.data.data;
              orgVM.cusPhoneId = text;
            if(isShowRepetition){
              orgVM.operatingArea = clueRepetitionDTO.operatingArea ;
              orgVM.investigateTime = orgVM.dateTimeFormats(clueRepetitionDTO.investigateTime) ;
              orgVM.investigateArea = clueRepetitionDTO.investigateArea ;
              orgVM.projectName = clueRepetitionDTO.projectName ;
              orgVM.consultResults = orgVM.consultResultsNum(clueRepetitionDTO.consultResults) ;
            }
            orgVM.remarkId = clueRepetitionDTO.remark;
            orgVM.dealRemarkId = clueRepetitionDTO.dealRemark;
            if(clueRepetitionDTO.status ==0){
              orgVM.statusId = "待处理" ;
              orgVM.dealStatusId = "";
            }else{
              orgVM.statusId = "已处理" ;
              if(clueRepetitionDTO.dealStatus ==0){
                orgVM.dealStatusId = "不重单";
              }else{
                orgVM.dealStatusId = "重单";
                orgVM.isShow=true;
                if(clueRepetitionDTO.clueRepetitionDTOs !=null){
                  orgVM.repetitionDetailList = clueRepetitionDTO.clueRepetitionDTOs;
                }
              }

            }
          }else{
            alert(response.data.data.msg);
            return ;
          }
        }).catch(function (error) {
          console.log(error);
        })
        .then(function () {
          // always executed
        });
      },
      cancelButton(){
        this.$confirm("确定要撤销选中的重单申请?", '撤销申请', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          // 查询 table 需要数据
          var param = {};
          var deleInfo=this.multipleSelection;
          var ids="";
          if(null!=deleInfo){
            for ( var i = 0; i <deleInfo.length; i++){
              if("" == ids){
                ids = deleInfo[i].id
              }else{
                ids = ids+","+deleInfo[i].id
              }
            }
            var param={};
            param.ids=ids;
            axios.post('/invitearea/deleInviteArea',param).then(function (response) {
              console.log(response);
              if(null !==response && response.data !=null && response.data.code=='0'){
                window.location.href="/invitearea/inviteAreaList";
              }else{
                alert(response.data.data.msg);
                return ;
              }
            }).catch(function (error) {
              console.log(error);
            })
            .then(function () {
              // always executed
            });

          }
        }).catch(() => {
          this.$message({
            type: 'info',
            message: '已取消删除'
          });
        });
      },
      search(){
        this.pager.currentPage = 1;
        this.queryRepeatPage();
      },
      handleSelectionChange(val) {
        this.multipleSelection = val;
      },
      transformStatus(row, column, cellValue, index) {
        var text="";
        if(cellValue=="0"){
          text="启用"
        }else if(cellValue=="1"){
          text="禁用"
        }
        return text;
      },
      addCent(value){
        return value.repeatRatio+"%";
      },
      paytype(row, column, cellValue, index) {
        var text="";
        if(cellValue=="1"){
          text="全款"
        }else if(cellValue=="2"){
          text="定金"
        }else if(cellValue=="3"){
          text="追加定金"
        }else if(cellValue=="4"){
          text="尾款"
        }
        return text;
      },
      payMode(row, column, value, index) {
        var valText="";
        if(!value){
          return valText;
        }
        var vals = value.split(",");
        if(payModeItem){
          for(var j = 0 ; j < vals.length;j++  ){
            for(var i = 0; i < payModeItem.length ; i++){
              if(payModeItem[i].value == vals[j]){
                if(j==0){
                  valText += payModeItem[i].name;
                }else{
                  valText += ","+payModeItem[i].name;
                }

              }
            }
          }
        }
        return valText;
      },
      repeatPhonesClick(row) {//重复手机号按钮点击
        console.log(row);
        this.dailogTitleType=row.clueId;
        var param ={};
        param.id = row.clueId;
        param.clueId = row.clueId;
        param.cusPhone = row.cusPhone;
        //自定义参数，为0时不走移除自身资源方法
        param.isRemove = 0;
        if((roleCode =='DXCYGW' && row.teleSaleIds.indexOf(userId) == -1 )
            ||  (roleCode =='DXZJ' && row.teleGorupIds.indexOf(orgId) == -1)
            ||  (roleCode =='DXFZ' && row.teleDeptIds.indexOf(orgId) == -1)
            || row.phase ==7 || row.phase == 8){
          this.$message({
            message: "当前资源已释放到公有池，不允许进行重复手机号资源的查看",
            type: 'error'
          });
          return;
        }
        this.repeatPhonesDialog=true;
        axios.post('/clue/appiontment/repeatPhoneMap', param).then(function (response) {
          var map = response.data.data;
          debugger
          if(map.phone){
            orgVM.phone = map.phones[0]
            orgVM.repeatPhonesTable=map.phone;
            orgVM.showPhoneTable = true;
          }else{
            orgVM.phone = '';
            orgVM.repeatPhonesTable=[];
            orgVM.showPhoneTable = false;
          }
          if(map.phone2){
            orgVM.phone2 = map.phones[1]
            orgVM.repeatPhonesTable2=map.phone2;
            orgVM.showPhoneTable2 = true;
          }else{
            orgVM.phone2 ='';
            orgVM.repeatPhonesTable2=[];
            orgVM.showPhoneTable2 = false;
          }
          if(map.phone3){
            orgVM.phone3 = map.phones[2]
            orgVM.repeatPhonesTable3=map.phone3;
            orgVM.showPhoneTable3 = true;
          }else{
            orgVM.phone3 = '';
            orgVM.repeatPhonesTable3=[];
            orgVM.showPhoneTable3 = false;
          }
          if(map.phone4){
            orgVM.phone4 = map.phones[3]
            orgVM.repeatPhonesTable4=map.phone4;
            orgVM.showPhoneTable4 = true;
          }else{
            orgVM.phone4 = ''
            orgVM.repeatPhonesTable4=[];
            orgVM.showPhoneTable4 = false;
          }
          if(map.phone5){
            orgVM.phone5 = map.phones[4]
            orgVM.repeatPhonesTable5=map.phone5;
            orgVM.showPhoneTable5 = true;
          }else{
            orgVM.phone5 = map.phones[4]
            orgVM.repeatPhonesTable5=[];
            orgVM.showPhoneTable5 = false;
          }
          orgVM.repeatPhonesDialog=true;
        })  .catch(function (error) {
          console.log(error);
        });

      },
      repeatDetailButton(row) {//重复手机号按钮点击
        console.log(row);
        var param ={};
        param.repeatId = row.repeatId;
        console.info(param);
        axios.post('/clue/cluerepetition/getRepeatDetailsByRepeatId', param)
        .then(function (response) {
          var result =  response.data.data;
          console.info(result);
          if(result.payDetailDTOs !=null && result.payDetailDTOs.length>0){
            orgVM.repeatDetaildialogFormVisible = true;
            orgVM.detailList = result.payDetailDTOs;
          }else{
            orgVM.payDetailList = result.clueRepetitionDTOs;
            orgVM.repeatPayDetaildialogFormVisible= true;
          }

        })  .catch(function (error) {
          console.log(error);
        });

      },
    },
    created(){
      // 取页数存储
      var localVal=localStorage.getItem('allChangePageSize')?parseInt(localStorage.getItem('allChangePageSize')):'';
      if(localVal){this.pager.pageSize = localVal;}
      this.queryRepeatPage();
      document.getElementById('organizationManage').style.display = 'block';
        // 判断是否显示面包屑
        var type=getQueryString("type");
        if(type==1){
            // 隐藏面包屑
            this.isElBreadcrumb=false;
        }

    }//created方法 结束
  })
</script>
</html>